﻿//
// Created by LiuYou on 2021/4/20.
//

#include <vector>
#include <iostream>
#include <algorithm>
#include <functional>

int main() {
    int integerArray[6] = {27, 210, 12, 47, 109, 83};
    std::vector<int, std::allocator<int>> integerVector(integerArray, integerArray + 6);
    // 大于等于40的元素个数。
    std::cout << std::count_if(integerVector.begin(), integerVector.end(),
                               std::not1(std::bind2nd(std::less<int>(), 40))) << std::endl;

    integerArray[0] = 1;
    for (const auto& item : integerArray) {
        std::cout << item << " ";
    }
    std::cout << std::endl;
    for (const auto& item : integerVector) {
        std::cout << item << " ";
    }
    std::cout << std::endl;
    return 0;
}